home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1994 / MacHack 1994.toast / MacHack™94 / Talks & Papers / Timothy Knox / yerk 3.66 / Asm source / 2d-array next >
Text File  |  1994-06-24  |  479b  |  24 lines

  1. \ general 2 dimensional array class. Want this to be in the dictionary
  2. \  since it is pre-loaded with values
  3. :CLASS 2dArray <super array
  4.  
  5.     int xlimit
  6.     int ylimit
  7.  
  8. :M xlimit: get: xlimit ;M
  9. :M yLimit: get: ylimit ;M
  10.  
  11. ( i j -- n )
  12. :M ^ELEM: get: xlimit * + 4*  idxbase + ;M
  13.  
  14. ( 0.66 msec )
  15. :M AT:  ^elem: self @ ;M
  16. ( .60 msec )
  17. :M TO: ^elem: self ! ;M
  18.  
  19. :M CLASSINIT: { x \ y -- } limit: self -> y
  20.     x put: xlimit y put: ylimit
  21.     x y * dup ^base 6 + w! y - 4* reserve ;M
  22.  
  23. ;CLASS
  24.